﻿using Microsoft.EntityFrameworkCore.Metadata.Builders;
using OpenAdmin.Core.DbContextLocators;
using OpenAdmin.Core.Models;

namespace OpenAdmin.EntityFramework;

[AgilityDbContext("Default", $"{DatabaseProvider.MySql}@8.0.30")]
public class BloggingDbContext : AgilityDbContext<BloggingDbContext, BloggingDbContextLocator>, IEntityTypeBuilderFilter
{
    public DbSet<Blog> Blogs { get; set; }
    public DbSet<Post> Posts { get; set; }
    public DbSet<BlogPostsCount> BlogPostCounts { get; set; }
    public BloggingDbContext(DbContextOptions<BloggingDbContext> options) : base(options)
    {

    }

    public void OnCreating(EntityTypeBuilder entityTypeBuilder, DbContext dbContext)
    {
        
    }

    public void OnCreated(EntityTypeBuilder entityTypeBuilder, DbContext dbContext)
    {

    }
}
